<template>
  <el-card class="operate-container" shadow="never">
    <i class="el-icon-tickets" />
    <span>岗位列表</span>

    <el-table
      ref="multipleTable"
      :data="tableData"
      :default-sort="{prop: 'id'}"
      tooltip-effect="dark"
      style="width: 100%"
      @selection-change="handleSelectionChange"
    >
      <el-table-column type="selection" width="55" />
      <el-table-column label="岗位编号" prop="id" sortable>
        <template slot-scope="scope">{{ scope.row.id }}</template>
      </el-table-column>
      <el-table-column prop="name" label="岗位" sortable />
      <el-table-column prop="depart.name" label="部门" sortable />
      <el-table-column prop="status" label="状态" sortable />
    </el-table>
    <div style="margin-top: 20px">
      <el-button type="primary" @click="deliver()">选择岗位,招聘申请</el-button>
    </div>

  </el-card>

</template>

<script>
// 传代部门名字的岗位列表
import { getList } from '@/api/recruit'

export default {
  data() {
    return {
      tableData: [],
      multipleSelection: []
    }
  },
  created: function() {
    // 获取岗位信息
    getList().then((res) => {
      this.tableData = res.data
    })
  },
  methods: {

    // 获取多选数据的数组
    handleSelectionChange(val) {
      this.multipleSelection = val
    }
  }
}
</script>
